<?php
/**
 * Prado Portal.
 *
 * @author Steen Rabol <steen.rabol@gmail.com>
 * @link http://www.pradoportal.dk/
 * @copyright Copyright &copy; 2006,2007,2008 Steen Rabol
 * @license http://www.pradoportal.dk
 * @version $Id: PortalPageService.php 387 2010-12-22 14:06:40Z steen.rabol $
 * @package Pradoportal.Common
 *
 */

/**
 *
 * @package Pradoportal.Common
 */
Prado::using('Application.Common.PortalThemeManager');

class PortalPageService extends TPageService
{
	public function run()
	{
		try
		{
			parent::run();
		}
		catch(Exception $e)
		{
			if($this->Application->Mode == TApplicationMode::Debug)
			{
				throw $e;
			}
			else
			{
				if($e instanceof THttpException)
				{
					throw new PortalException($e->getErrorCode(),$e->getErrormessage());
				}
				else
				{
					throw new PortalException($e->getCode(),$e->getMessage());
				}
			}
		}
	}

	public function constructUrl($pagePath,$getParams=null,$encodeAmpersand=true,$encodeGetItems=true)
	{
		return parent::constructUrl($pagePath,$getParams,false,$encodeGetItems);
	}

}
?>